<!--
 * @Author: lsjweiyi 759209794@qq.com
 * @Date: 2023-06-18 11:40:57
 * @LastEditors: lsjweiyi 759209794@qq.com
 * @LastEditTime: 2024-05-12 18:52:27
 * @FilePath: \web-ssg\pages\home\About.vue
 * @Description: 网站整体的导航
-->
<template>
    <div class="title">{{ homeItem.name }}</div>
    <div style="padding-left: 5px; padding-right: 5px">
        <n-h1 prefix="bar">图像处理类</n-h1>
        <div v-for="item in imageMenuList" class="card" @click="navigateTo(getRouterPath(item))">
            <n-p style="font-weight: bolder;">{{ item.name }}</n-p>
            <n-p style="color: gray">
                {{ item.description }}
            </n-p>
        </div>
        <n-h1 prefix="bar">其他</n-h1>
        <div v-for="item in homeMenuList" class="card" @click="navigateTo(getRouterPath(item))">
            <n-p style="font-weight: bolder;">{{ item.name }}</n-p>
        </div>
    </div>
</template>
<script setup lang="ts">
const homeItem = getHomeMenuItem("");
useHead({
    title: homeItem.name,
});

const getRouterPath = (item: MenuItem) => {
    if (item.key === "index") {
        return "/";
    } else if (item.key === "") {
        return "/" + item.routerName;
    } else if (item.routerName === "") {
        return "/" + item.key;
    } else {
        return "/" + item.key + "/" + item.routerName;
    }
};
</script>
<style lang="scss">
.center {
    flex: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.card {
    $color: #eaf3ec;
    width: 90%;
    height: auto;
    border-radius: 25px;
    background-color: $color;
    padding: 10px;
    box-shadow: 10px 10px 10px darken($color, 20%);
    margin: 10px;

    &:active {
        background-color: darken($color, 5%);
        cursor: pointer;
    }
}
</style>
<style  scoped>
.title::after {
    content: '小站总览';
    position: absolute;
    left: 0;
    color: black;
    transform: translate(130px, 6px) scaleX(1) scaleY(0.5) skew(50deg);
    z-index: -1;
    filter: blur(1px);
    mask: linear-gradient(transparent, black);
}
</style>